package com.cn.xiaonuo.slbfinances.shopassets.controller;

import com.cn.xiaonuo.common.entity.BusinessMessage;
import com.cn.xiaonuo.slbfinances.shopassets.param.PageMerchantAssetsParam;
import com.cn.xiaonuo.slbfinances.shopassets.param.PageRevenueDetailsParam;
import com.cn.xiaonuo.slbfinances.shopassets.service.SlRevenueDetailsService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @BelongsProject: slb-reports-java
 * @Author: likui
 * @CreateTime: 2022-12-21  17:27
 * @Description: TODO
 */
@RestController
public class SlRevenueDetailsController {
    @Autowired
    private SlRevenueDetailsService slRevenueDetailsService;

    @ApiOperation(value = "定时同步收入明细", notes = "定时同步收入明细")
    @RequestMapping(value ="/api/common/revenueDetails/timingRevenueDetails", method = RequestMethod.POST)
    public BusinessMessage revenueDetails(){
        return slRevenueDetailsService.revenueDetails();
    }

    @ApiOperation(value = "收入明细列表", notes = "收入明细列表")
    @RequestMapping(value ="/api/revenueDetails/pageRevenueDetails", method = RequestMethod.POST)
    public BusinessMessage pageRevenueDetails(@RequestBody PageRevenueDetailsParam param){
        return slRevenueDetailsService.pageRevenueDetails(param);
    }

    @ApiOperation(value = "收入明细列表导出", notes = "收入明细列表导出")
    @RequestMapping(value ="/api/revenueDetails/revenueDetailsExcel", method = RequestMethod.GET)
    public void revenueDetailsExcel(HttpServletResponse response, PageRevenueDetailsParam param){
        slRevenueDetailsService.revenueDetailsExcel(response,param);
    }

}
